@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}
<div class="bg-gray">

    <header class="mui-bar mui-bar-nav head-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title">申请地信掌门人</h1>
    </header>
    <!--DOM -->
    <div class="mui-content bg-gray">
        <!---->
        <div class="sq-dxzmr">
            <div class="mui-input-group sq-dxzmr-input-group">
                <div class="mui-input-row">
                    <label>公司名称：</label>
                    <input type="text" placeholder="请输入公司名称" class="j-name">
                </div>
                <div class="mui-input-row">
                    <label>公司职务：</label>
                    <input type="text" class="mui-input-clear j-zhiwu" placeholder="请输入公司职务">
                </div>
                <div class="mui-input-row">
                    <label>工作年限：</label>
                    <input type="text" class="mui-input-clear j-nianxian" placeholder="请输入工作年限">
                </div>
                <div class="mui-input-row">
                    <label>参与项目：</label>
                    <input type="text" class="mui-input-clear j-proj" placeholder="请输入参与项目">
                </div>
                <div class="mui-input-row">
                    <label>联系电话：</label>
                    <input type="text" class="mui-input-clear j-mobile" placeholder="请输入联系电话">
                </div>
                <div class="mui-input-row">
                    <label>微信：</label>
                    <input type="text" class="mui-input-clear j-wx" placeholder="请输入微信账户">
                </div>
            </div>

            <br />

            <!---->
            <button class="mui-btn mui-btn-block mui-btn-green res-btn">提交申请</button>
            <br />
        </div>
        <br />
        <!---->
    </div>

</div>
@section Scripts{
	<script>
		$(".res-btn").click(function () {
			if ($(".j-name").val().length==0) {
				layerm.open({
				content: '请输入正确的公司名称'
				,btn: '确定'
				});
				return false;
			}
			
			if ($(".j-zhiwu").val().length==0) {
				layerm.open({
				content: '请输入正确的职务'
				,btn: '确定'
				});
				return false;
			}
			
			
			if ($(".j-nianxian").val().length==0) {
				layerm.open({
				content: '请输入工作年限'
				,btn: '确定'
				});
				return false;
			}
			
			if ($(".j-proj").val().length==0) {
				layerm.open({
				content: '请输入参与项目'
				,btn: '确定'
				});
				return false;
			}
			
			if ($(".j-mobile").val().length!=11) {
				layerm.open({
				content: '请输入手机号'
				,btn: '确定'
				});
				return false;
			}
			
			if ($(".j-wx").val().length==0) {
				layerm.open({
				content: '请输入微信号'
				,btn: '确定'
				});
				return false;
			}
			
			$.ajax({
				type:"post",
				url:'@Url.Action("AjaxApply")',
				data: { name: $(".j-name").val(), duties: $(".j-zhiwu").val(), period: $(".j-nianxian").val(), project: $(".j-proj").val(), tel: $(".j-mobile").val(), wx: $(".j-wx").val()},
				success: function (result) {
					if (result.state=="ok") {
					layerm.open({
					content: result.msg
					,btn: '确定',
					yes:function () {
						location.href='@Url.Action("Index", "User")';
					}
					});
					
				}else if(result.state=="login"){
					location.href='@Url.Action("Index","Login")';
				}else{
					layerm.open({
					content: result.msg
					,btn: '确定',
					yes:function () {
						location.href='@Url.Action("Index","User")';
					}
					});
				}
				}
				
				
			})
			
			
		})
		
		
	</script>
}